import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/api/sold-orders',
    method: 'get',
    params: query
  })
}

export function createSoldOrder(data) {
  let url = '/api/sold-orders'
  return request({
    url: url,
    method: 'post',
    data
  })
}

export function saveSoldOrder(id,data) {
  let url = '/api/sold-orders/' + id
  return request({
    url: url,
    method: 'post',
    data
  })
}

export function closeSoldOrder(id) {
  let url = '/api/sold-orders/' + id + '/close'
  return request({
    url: url,
    method: 'post'
  })
}
